This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter. # Cellchat
source("./tianfengRwrappers.R")
library(CellChat)
ds2 <- readRDS("ds2.rds")
CA_dataset2 <- readRDS("CA_dataset2.rds")
# saveRDS(CA_dataset2,"CA_dataset2.rds")
umapplot(CA_dataset2)
Warning: Using `as.character()` on a quosure is deprecated as of rlang 0.3.0.
Please use `as_label()` or `as_name()` instead.
This warning is displayed once per session.
f("DLX5",EC_SMC)
umapplot(EC_SMC)
saveRDS(EC_SMC,"EC_SMC.rds")
computeAveExpr(cor, features = c("BMP2","BMP4","BMP6","BMPR1B","BMPR1A","BMPR2","ACVR2A"), type = "truncatedMean", trim = 0.05)
3 EC0 EC1 EC2 Fibroblast Fibromyocyte Pericyte SMC1 SMC2
BMP2 0.03150669 0.02623810 0.003702709 0.202131802 0.00000000 0.00000000 0.028212306 0.000000000 0.00000000
BMP4 0.00000000 0.02969807 0.064427142 0.535072542 0.14289603 0.05976591 0.000000000 0.008078115 0.02235959
BMP6 0.33885091 0.00000000 0.000000000 0.430656995 0.00000000 0.00000000 0.000000000 0.000000000 0.00000000
BMPR1B 0.00000000 0.00000000 0.000000000 0.000000000 0.08194540 0.00000000 0.000000000 0.008751292 0.07602259
BMPR1A 0.00000000 0.00000000 0.000000000 0.006539124 0.05175499 0.03366126 0.009241962 0.057668768 0.02832214
BMPR2 0.30466733 0.28211628 0.328085107 0.880202371 0.11521646 0.13015395 0.078799890 0.157702091 0.11248721
ACVR2A 0.00000000 0.00000000 0.000000000 0.000000000 0.01848392 0.00000000 0.000000000 0.000000000 0.00000000
write.csv(df.net,"./datatable/EC_SMC_cellchat_res.csv", row.names = F)
cor <- readRDS("EC_SMC_cellchat.rds")
Loading required package: CellChat
Loading required package: igraph
Attaching package: ‘igraph’
The following object is masked from ‘package:circlize’:
degree
The following object is masked from ‘package:Mfuzz’:
membership
The following object is masked from ‘package:DynDoc’:
path
The following objects are masked from ‘package:BiocGenerics’:
normalize, path, union
The following object is masked from ‘package:plotly’:
groups
The following object is masked from ‘package:clusterProfiler’:
simplify
The following object is masked from ‘package:tidyr’:
crossing
The following objects are masked from ‘package:dplyr’:
as_data_frame, groups, union
The following objects are masked from ‘package:stats’:
decompose, spectrum
The following object is masked from ‘package:base’:
union
Registered S3 methods overwritten by 'registry':
method from
print.registry_field proxy
print.registry_entry proxy
#指定pathway
pathways.show <- c("BMP")
netVisual_aggregate(cor, signaling = pathways.show, layout = "circle")
# netVisual_aggregate(cor, signaling = pathways.show, layout = "chord")
# Heatmap
netVisual_heatmap(cor, signaling = pathways.show, color.heatmap = c("#f1f1f1", "#ff2121"))
Do heatmap based on a single object
netVisual_bubble(cor, sources.use = 4, targets.use = c(5:9), pairLR.use = LR_show, remove.isolate = F) #EC2 target
Comparing communications on a single object
Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Ctrl+Alt+I.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Ctrl+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.